import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView,
    redirect:'/shouye',
    children:[
      {
        path:'shouye',
        name:'shouye',
        component:()=>import("../views/home/shouye.vue")
      },
      {
        path:"shequ",
        name:'shequ',
        component:()=>import("../views/home/shequ.vue")
      },
      {
      path:'tianjia',
      name:'tianjia',
      component:()=>import("../views/home/tianjia.vue")
      },
      {
        path:'qingdan',
        name:'qingdan',
        component:()=>import("../views/home/qingdan.vue")
      },
      {
        path:'wode',
        name:'wode',
        component:()=>import("../views/home/wode.vue")
      }
    ]
  },
  {
    path:'/likesinfo/:lid',
    name:'likesinfo',
    component:()=>import("../views/likesinfo.vue")
  },
  {
    path:'/fenlei',
    name:'fenlei',
    component:()=>import("../views/fenlei/fenlei.vue"),
    redirect:"/fenlei/hotmeun",
    children:[
      {
        path:'hotmeun',
        name:'hotmeun',
        component:()=>import("../views/fenlei/hotmeun.vue")
      },
      {
        path:'yimian',
        name:'yimian',
        component:()=>import("../views/fenlei/yimian.vue")
      }
    ]
  },
  {
    path: '/about',
    name: 'about',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
